<?php

/**
 * Pdo类 Yjnic_Db_Factory
 *
 * @author prettyyjnic <prettyyjnic@qq.com> 20151027
 */
class Yjnic_Db_Factory{
    static $_pdos = array();

    private function __construct(){}
    private function __clone(){}

    // 获取单例
    static public function getInstance($config, $debug=false){
        if (!isset($_pdos[$config['dbname']])) {
            $_pdos[$config['dbname']] = new Yjnic_Db_Pdo($config, $debug);
        }
        return $_pdos[$config['dbname']];
    }
}